<?php

namespace brand\components;

class Editor extends Component
{
    public function _init()
    {
        $this->component = 'editor';
    }

    public function Form()
    {
        parent::Form();

        $this->columnsCheckPublic();
        $this->form_column->props(
                [
                    'uploadUrl' => $this->upload_url, // 上传地址
                    'manageUrl' => $this->manage_url, // 文件管理地址
                    'typeName'  => 'type',        // 不同类型文件上传携带的参数 类型KEY
                    'config'    => [                // wangEditor配置参数
                        'showLinkImgAlt' => false,
                    ],
                ]);


        return $this->form_column;
    }



    public function DbToCurd($field, $props = [])
    {
        return \brand\Brand::Builder()->form_props($props)->table(false)->form_method('editor');
    }

}